<?php
declare(strict_types=1);

namespace app\common\model\delivery;

use think\Model;

class SellerSettlement Extends Model
{
    public function getYuefuOrderAttr($data)
    {
        if($data){
            return json_decode($data,true);
        }else{
            return ['money'=>0,'order'=>0,'towel_dai'=>0,'towel_tiao'=>0];
        }
    }

    public function getLingshouOrderAttr($data)
    {
        if($data){
            return json_decode($data,true);
        }else{
            return ['money'=>0,'order'=>0,'towel_dai'=>0,'towel_tiao'=>0];
        }
    }

    public function getPackageOrderAttr($data)
    {
        if($data){
            return json_decode($data,true);
        }else{
            return ['order'=>0,'towel_dai'=>0,'towel_tiao'=>0];
        }
    }

    public function child()
    {
        return $this->hasMany(self::class,'pid','id',[]);
    }
}
